package com.lujianfei.android_app_list.base

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.lujianfei.android_app_list.adapter.GridAdapter

abstract class BaseRecyclerAdapter<T>: RecyclerView.Adapter<RecyclerView.ViewHolder>() {

    val mData = arrayListOf<T>()

    override fun getItemCount(): Int = mData.size

    fun setData(data:List<T>) {
        mData.clear()
        mData.addAll(data)
        notifyDataSetChanged()
    }

    open class BaseViewHolder(itemView: View) :RecyclerView.ViewHolder(itemView) {

    }
}